﻿namespace Blaze.Framework.MonoEventListeners
{
    using UnityEngine;

    public class Trigger2D : MonoBehaviour
    {
        public event Collider2DEventHandler OnTriggerEnter2DEvent;

        public event Collider2DEventHandler OnTriggerExit2DEvent;

        public event Collider2DEventHandler OnTriggerStay2DEvent;

        private void OnTriggerEnter2D(Collider2D collider)
        {
            if (OnTriggerEnter2DEvent != null)
                OnTriggerEnter2DEvent(gameObject, collider);
        }

        private void OnTriggerExit2D(Collider2D collider)
        {
            if (OnTriggerExit2DEvent != null)
                OnTriggerExit2DEvent(gameObject, collider);
        }

        private void OnTriggerStay2D(Collider2D collider)
        {
            if (OnTriggerStay2DEvent != null)
                OnTriggerStay2DEvent(gameObject, collider);
        }
    }
}